package com.site.war.service.impl;

import java.util.List;
import java.util.Map;

import com.site.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.site.war.mapper.SiteWarningMapper;
import com.site.war.domain.SiteWarning;
import com.site.war.service.ISiteWarningService;

/**
 * 预警信息Service业务层处理
 *
 * @author site
 * @date 2023-10-10
 */
@Service
public class SiteWarningServiceImpl implements ISiteWarningService
{
    @Autowired
    private SiteWarningMapper siteWarningMapper;

    /**
     * 查询预警信息
     *
     * @param id 预警信息主键
     * @return 预警信息
     */
    @Override
    public SiteWarning selectSiteWarningById(Long id)
    {
        return siteWarningMapper.selectSiteWarningById(id);
    }

    /**
     * 查询预警信息列表
     *
     * @param siteWarning 预警信息
     * @return 预警信息
     */
    @Override
    public List<SiteWarning> selectSiteWarningList(SiteWarning siteWarning)
    {
        return siteWarningMapper.selectSiteWarningList(siteWarning);
    }

    /**
     * 新增预警信息
     *
     * @param siteWarning 预警信息
     * @return 结果
     */
    @Override
    public int insertSiteWarning(SiteWarning siteWarning)
    {
        siteWarning.setCreateTime(DateUtils.getNowDate());
        return siteWarningMapper.insertSiteWarning(siteWarning);
    }

    /**
     * 修改预警信息
     *
     * @param siteWarning 预警信息
     * @return 结果
     */
    @Override
    public int updateSiteWarning(SiteWarning siteWarning)
    {
        return siteWarningMapper.updateSiteWarning(siteWarning);
    }

    /**
     * 批量删除预警信息
     *
     * @param ids 需要删除的预警信息主键
     * @return 结果
     */
    @Override
    public int deleteSiteWarningByIds(Long[] ids)
    {
        return siteWarningMapper.deleteSiteWarningByIds(ids);
    }

    /**
     * 删除预警信息信息
     *
     * @param id 预警信息主键
     * @return 结果
     */
    @Override
    public int deleteSiteWarningById(Long id)
    {
        return siteWarningMapper.deleteSiteWarningById(id);
    }

    @Override
    public List<Map<String, Object>> getTodayWarningTrend() {
        return siteWarningMapper.getTodayWarningTrend();
    }

    @Override
    public List<Map<String, Object>> getDeviceWarningProportion() {
        return siteWarningMapper.getDeviceWarningProportion();
    }

    @Override
    public List<Map<String, Object>> getWarningYearWeek() {
        return siteWarningMapper.getWarningYearWeek();
    }

    @Override
    public List<Map<String, Object>> getWarningYearMonth() {
        return siteWarningMapper.getWarningYearMonth();
    }

    @Override
    public List<Map<String, Object>> getWarningManageOne() {
        return siteWarningMapper.getWarningManageOne();
    }

    @Override
    public List<Map<String, Object>> getWarningManageTwo() {
        return siteWarningMapper.getWarningManageTwo();
    }

    @Override
    public List<Map<String, Object>> getWarningType() {
        return siteWarningMapper.getWarningType();
    }

    @Override
    public int getAllCount() {
        return siteWarningMapper.getAllCount();
    }

    @Override
    public List<Map<String, Object>> getWarningBySiteNumber(String siteNumber) {
        return siteWarningMapper.getWarningBySiteNumber(siteNumber);
    }

    @Override
    public List<Map<String, Object>> getWarningByTowerNumber(String towerNumber) {
        return siteWarningMapper.getWarningByTowerNumber(towerNumber);
    }
}
